package com.luckeys.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.luckeys.dao.LocationDao;
import com.luckeys.service.LocationService;
import com.luckeys.vo.LocationVO;
import com.luckeys.vo.PageVO;

@Service
public class LocationServiceImpl implements LocationService {

	@Autowired
	private LocationDao locationDao;
	
	public List<LocationVO> queryLocationList(LocationVO location) {
		return locationDao.queryLocationList(location);
	}
	
	public List<LocationVO> queryListLocation(LocationVO location) {
		return locationDao.queryListLocation(location);
	}

	public PageVO<LocationVO> queryLocationPage(LocationVO location) {
		PageVO<LocationVO> page = new PageVO<LocationVO>();
		page.setData(locationDao.queryLocationPage(location));
		page.setTotalRecords(locationDao.queryLocationCount(location));
		return page;
	}

	public int addLocation(LocationVO location) {
		return locationDao.addLocation(location);
	}

	public int deleteLocation(String locationUuid) {
		return locationDao.deleteLocation(locationUuid);
	}

	public LocationVO queryLocationById(String locationUuid) {
		return locationDao.queryLocationById(locationUuid);
	}

	public int updateLocation(LocationVO location) {
		return locationDao.updateLocation(location);
	}

}
